<template>
  <div>
    <div class="header">
      <div class="header_left">
        <!-- <h3>{{headerCon.title}}</h3>
        <div>
          <el-breadcrumb separator="/">
            <el-breadcrumb-item v-for="route in breadcrumbRoutes" :key="route.path" :to="{ path: route.path }">{{
              route.meta.title }}
            </el-breadcrumb-item>
          </el-breadcrumb>
        </div> -->
      </div>
      <div class="header_right">
        <!-- <div class="tabs">
          <p @click="selTabClick(1)" :class="tabIndex===1 ? 'istabs' : ''">
            <i class="el-icon-menu"></i>
          </p>
          <p @click="selTabClick(2)" :class="tabIndex===2 ? 'istabs' : ''">
            <i class="el-icon-tickets"></i>
          </p>
        </div> -->
        <div class="search_input">
          <!-- <el-input placeholder="请输入" v-model="headerCon.infomation.searchKeys" class="input-with-select">
            <el-button slot="append" icon="el-icon-search"></el-button>
          </el-input> -->
          <el-input
            v-if="isDisplayInput"
            placeholder="请输入"
            v-model="headerCon.infomation.searchKeys"
            size="mini"
            class="input-with-select"
          >
            <i slot="prefix" class="el-input__icon el-icon-search"></i>
          </el-input>
          <el-button type="primary" @click="addDevice">
            <i class="el-icon-plus" style="font-size: 16px"></i>
            设备认证</el-button
          >
          <!-- <div class="common-tab"> -->
          <div @click="selTabClick(1)" class="common-tab" :class="tabIndex === 1 ? 'common-tab1' : ''">
            <!-- <i class="el-icon-menu"></i> -->
            <SvgIcon icon-class="CardViewicon" class="img-box" :class="tabIndex === 1 ? 'istabs' : ''" />
          </div>
          <!-- </div>
          <div class="common-tab"> -->
          <div @click="selTabClick(2)" class="common-tab" :class="tabIndex === 1 ? 'common-tab1' : ''">
            <!-- <i class="el-icon-tickets"></i> -->
            <SvgIcon icon-class="ListIcon" class="img-box" :class="tabIndex === 2 ? 'istabs' : ''" />
          </div>
          <!-- </div> -->
          <!-- <el-button>导出</el-button> -->
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// import SnapFrame from "@/views/panoramicData/components/SnapFrame.vue"
export default {
  name: "devicePage",
  props: {
    headerContent: {
      type: Object,
      default: () => {
        return {
          title: "设备详情",
          infomation: {}
        }
      }
    }
  },
  data() {
    return {
      headerCon: this.headerContent,
      tabIndex: 2,
      isDisplayInput: true
    }
  },
  computed: {
    breadcrumbRoutes() {
      return this.$route.matched // 获取当前路由的所有嵌套路径段
    }
  },
  created() {},
  mounted() {},
  watch: {},
  methods: {
    selTabClick(idx) {
      if (idx === 1) {
        this.tabIndex = 1
        this.isDisplayInput = false
      } else if (idx === 2) {
        this.tabIndex = 2
        this.isDisplayInput = true
      }
      this.$emit("selTabClick", idx)
    },
    addDevice() {
      this.$emit("addDevice")
    }
  },
  components: {
    //  SnapFrame
  }
}
</script>

<style scoped lang="scss">
.header {
  width: 100%;
  height: 40px;
  background-color: #141415;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  display: flex;
  // margin-top: 20px;
  color: #fff;
  margin: 10px 0px;

  .header_left {
    width: 18%;
    // height: 50px;
    box-sizing: border-box;

    // display:flex;
    // overflow:hidden;
    h3 {
      margin: 0 0 10px 0;
      font-size: 30px;
      color: #fff;
    }

    .el-breadcrumb {
      color: #fff !important;
    }
  }
  .header_right {
    display: flex;
    // flex-wrap: wrap;
    margin-right: 20px;
    // .tabs{
    //   width: 100%;
    //   display: flex ;
    //   justify-content: flex-end;
    //   // margin-right: 20px;
    //   p{
    //     width: 30px;
    //     height: 30px;
    //     line-height: 40px;
    //     background-color: #1F2935;
    //     border-radius: 5px;
    //     margin: 0;
    //     margin-bottom: 10px;
    //     cursor: pointer;
    //     margin-left: 10px;
    //     text-align: center;
    //     i{
    //       font-size: 22px;
    //     }
    //     i:hover{
    //       color:#328EFF;
    //     }
    //   }
    // }
    .search_input {
      width: 100%;
      height: 40px;
      display: flex;
      align-items: center;
      .el-button {
        // margin:0px 20px;
        margin-left: 20px;
        height: 28px;
        line-height: 28px;
        padding: 0px 20px;
      }
      .el-button:nth-of-type(2) {
        margin-right: 20px;
      }
      .el-input-group__append {
        width: 30px !important;
        .el-button {
          width: 30px;
          margin: 0;
          padding: 0;
        }
      }
      .common-tab {
        width: 73px;
        height: 40px;
        background: #1f2935;
        border-radius: 5px;
        cursor: pointer;
        margin-left: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        .img-box {
          font-size: 16px;
          fill: #8291a9;
        }
        .img-box:hover {
          fill: #328eff;
        }
        .istabs {
          fill: #328eff;
        }
      }
      .common-tab1 {
        width: 40px;
      }
    }
  }
}
::v-deep {
  .el-breadcrumb__inner {
    color: #fff !important;
  }
  .el-input-group {
    height: 28px !important;
    .el-input__inner {
      height: 30px !important;
    }
    .el-input-group__append {
      height: 28px !important;
    }
    .el-button {
      height: 28px !important;
    }
  }
  .el-input__inner {
    background: #1f2935;
    border: 0.00521rem solid #dcdfe600;
  }
}
</style>
